﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace DocMreoLiteVersion.Controls
{
    //Конвертер валидации введенной даты
    class MaskToDateConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parametr, System.Globalization.CultureInfo culture)
        {
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parametr, System.Globalization.CultureInfo culture)
        {

            String yearString = value as String;
            if (value != null && parametr != null)
                if ((value as String).Equals(parametr as String))
                    return null;
            
            return value;
        }
    }
}
